package com.demo.feign.service;

import com.demo.feign.service.hystrix.UserServiceHystrix;
import com.demo.feign.service.hystrix.UserServiceHystrix1;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 路由切换测试使用
 */
@FeignClient(name = "server-provider1",fallback = UserServiceHystrix1.class)  // 要调用服务的名字
public interface UserService1 {
    @RequestMapping(value = "/user/getNameByUserId/{id}", method = RequestMethod.GET) // 要调用路径 和方式
    public String getNameByUserId(@PathVariable("id") int id);
}
